home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
Archivers
/
SignArch
/
InstallSignArch
< prev
next >
Wrap
Text File
|
1996-09-26
|
17KB
|
1,092 lines
; Installer script for SignArch utility
; Use a tabsize equal to 4 when reading
; © 1994 Jens T. Berger Thielemann
; Distributed under the GNU General Public License.
; To contact the author:
; <jensthi@ifi.uio.no>
; or
; Jens Berger
; Spektrumveien 4
; N-0666 Oslo
; Norway
; or
; Send a message in POST to J. BERGER on Trashcan (A)BBS
; [(+47) 22 25 74 78 or (+47) 22 25 88 22].
; NO WARRANTIES AT ALL FOR FUNCTIONALITY OR FITNESS FOR A SPECIFIC PURPOSE
; $VER: InstallSignArch 1.1 (11.11.94) Copyright © 1994 Jens T. Berger Thielemann
; ********************** VARIOUS INITIALIZATION *************************
(procedure
getcommand
(
(if
(=
@user-level
2
)
(set
gcretval
(askfile
(prompt gcprompt)
(help gchelp)
(default gcdef)
)
)
(
(if
(exists "Sys:Rexxc/RX")
(set
gcretval
gcdef
)
(
(set
@user-level
2
)
(getcommand)
)
)
)
)
(set
@user-level
defuser
)
)
)
(procedure
getrexxpath
(
(set
@user-level
2
)
(set
rexxpath
(askdir
(prompt "Select directory for main REXX program. NO SPACES!")
(help
"The directory you select should be the same as you "
"put all your other REXX programs within.\n"
"REXX: is preferred, as AmigaDOS easier will find the "
"program. Spaces should be avoided in the path, as "
"the RX program doesn't understand them.\n\n"
@askdir-help
)
(default "REXX:")
)
)
(set
@user-level
defuser
)
(if
(<>
rexxpath
"REXX:"
)
(set
rexxpath
(expandpath rexxpath)
)
)
)
)
(set @app-name "SignArch")
(welcome)
(set
defuser
@user-level
)
(set
@user-level
2
)
; **************** VERIFY THAT USER HAS CHECKED FILES *******************
(askbool
(prompt
"Please verify that you already have checked files with MD5SUM and "
"PGP before running this script, either manually or with the "
"included script."
)
(help
"To check the files, type the following commands in a Shell:\n\n"
" PGP -kaa SignArch.sum\n"
" PGP -f <SignArch.sum >T:PGPTest.asc\n"
" MD5SUM -cv T:PGPTest.asc\n"
"An easier, although more insecure method is just to doubleclick "
"the Signarch.sum icon."
)
(default 1)
(choices
"Verified"
"Verified"
)
)
; ******************** CHECK THAT PGP IS INSTALLED **********************
(set
pgppathexists
(exists
"ENV:PGPPATH"
(noreq)
)
)
(if
(=
pgppathexists
1
)
(set
pgpdir
(getenv "PGPPATH")
)
(set
pgpdir
""
)
)
(if
(OR
(<>
pgppathexists
1
)
(=
pgpdir
""
)
)
(if
(askbool
(prompt
"PGPPATH is not initialized! Would you like to add a line"
"to your user-startup, telling PGP where it shall store "
"its files?"
)
(help
"PGPPATH should be initialized to the directory that "
"you wish that PGP should keep its keyrings, random "
"seeds, and other needed files. It does NOT have to "
"be the same dir as PGP is located within, "
"in fact, it may be a good idea to NOT keep these files "
"in the path.\n"
"Without this path set, PGP will not function correctly.\n\n"
"By selecting 'Yes', you will be prompted with a directory "
"requestor, and your 'User-Startup' will be updated.\n\n"
"NOTE: PGP must function correctly to make this program "
"work!"
)
(default 1)
(choices
"Yes"
"No"
)
)
(
(set
pgpdir
(expandpath
(askdir
(prompt "Please select directory for PGP files")
(help
"Within this directory, the files PGP needs, "
"will/should be put, among other keyrings, "
"random seeds, etc. For further information "
"about how to install PGP, please consult the "
"documentation for PGP.\n\n"
@askdir-help
)
(default "Sys:PGP/")
)
)
)
(set
@user-level
defuser
)
(startup
"PGP"
(prompt
"Do you wish to add PGPPATH information to your "
"'S:User-Startup' file?"
)
(help
"As explained earlier, PGP needs a path set to the dir "
"that it should put/find its files. This information "
"will be added to your 'S:User-Startup' file, which "
"is executed on every startup.\n\n"
@startup-help
)
(command
(cat
"Setenv PGPPATH \""
pgpdir
"\""
)
)
)
(if
(=
defuser
2
)
(run
(cat
"Setenv PGPPATH \""
pgpdir
"\""
)
(prompt
"Do you wish that this variable should be set at "
"once?"
)
(help
"Normally, the path variable won't be initialized "
"until you reboot. Select 'yes', and it will be set "
"at once."
)
(confirm)
)
(run
(cat
"Setenv PGPPATH \""
pgpdir
"\""
)
(prompt "Setting PGPPATH variable...")
(help
"Normally, the path variable won't be initialized "
"until you reboot. It will now be initialized at "
"once."
)
)
)
)
)
)
(set
@user-level
2
)
; ***************** CHECK THAT REQTOOLS IS INSTALLED ********************
(if
(<>
(exists "LIBS:reqtools.library")
1
)
(askbool
(prompt
"reqtools.library is missing. Please be aware of that the "
"GUI won't work until you've installed it in LIBS:."
)
(help
"reqtools.library (Copyright © 1991-94 Nico François) can "
"be found on most BBS's. Until it is installed, the GUI "
"won't start at all.\n"
"To install reqtools.library, please read/use the files "
"included with reqtools.library."
)
(default 1)
(choices
"Understood"
"Understood"
)
)
)
(set
@user-level
defuser
)
; ********************* GET PATH FOR REXX PROGRAM ***********************
(set
rexxpath
""
)
(if
(exists
"REXX:"
(noreq)
)
(if
(=
@user-level
2
)
(if
(askbool
(prompt
"Do you wish to install the REXX part of the program in "
"your REXX: assign? This is where REXX programs normally "
"are stored, and will help AmigaDOS find the program."
)
(help
"By selecting yes, the main program will be copied to "
"your REXX: assign. If you select no, you will be "
"presented with a directory requester."
)
(default 1)
)
(
(set
rexxpath
"REXX:"
)
)
(getrexxpath)
)
(
(set
rexxpath
"REXX:"
)
)
)
(
(getrexxpath)
)
)
(set
@user-level
defuser
)
; **************** COPY REXX PROGRAM & SET SCRIPT FLAG ******************
(copyfiles
(source "SignArch.rexx")
(dest rexxpath)
(prompt "Copying main REXX program")
(infos)
)
(copyfiles
(source "AddSum.rexx")
(dest rexxpath)
(prompt "Copying additional REXX programs")
)
(if
(=
@user-level
2
)
(set
doprotect
(askbool
(prompt "Set script flag on the REXX programs?")
(help
"By setting the script flag, there is no need to put a 'RX' in "
"front of the REXX program to run the program - AmigaDOS will "
"automagically run it correctly as a REXX program, adding a "
"lot of comfort."
)
(choices
"Yes"
"No"
)
(default 1)
)
)
(set
doprotect
1
)
)
(set
@user-level
1
)
(if
(=
doprotect
1
)
(
(run
(cat
'Protect "'
(tackon
rexxpath
"SignArch.rexx"
)
'" +s'
)
(prompt "Setting script flags on REXX programs...")
)
(run
(cat
'Protect "'
(tackon
rexxpath
"AddSum.rexx"
)
'" +s'
)
(prompt "Setting script flags on REXX programs...")
)
)
)
(set
@user-level
defuser
)
; *************** GET PATH FOR GRAPHICAL USER INTERFACE *****************
(set
@user-level
2
)
(set
guipath
(askdir
(prompt "Please select directory for GUI programs.")
(help
"Within this directory, the Graphical User Interface (GUI) "
"will be installed. Preferably, this directory should be "
"accessible from the Workbench, by icons, and also be in your "
"path.\n"
"Also, some stubs will be installed here, so you may start the "
"REXX scripts by icons.\n\n"
@askdir-help
)
(default "Sys:Utilities")
)
)
(set
@user-level
defuser
)
; ***************************** COPY GUI ********************************
(copyfiles
(source "SignArchGUI")
(dest guipath)
(prompt "Copying Graphical User Interface...")
(infos)
)
; ************************ INSTALL AMIGAGUIDE ***************************
(set
copyguide
(askbool
(prompt "Copy AmigaGuide documentation?")
(help
"The documentation needs to be copied to make sure that the "
"online help is available. If you select yes, you will "
"presented with a directory requester."
)
(choices
"Yes"
"No"
)
(default 1)
)
)
(if
(=
copyguide
1
)
(
(if
(exists
"HELP:"
(noreq)
)
(set
defguidepath
"HELP:"
)
(set
defguidepath
guipath
)
)
(set
guidepath
(askdir
(prompt "Select directory for documentation")
(help
"The AmigaGuide documentation will be put in the directory "
"you select. By copying it here, it will be available as "
"online help in the GUI, by pressing <HELP> over a gadget "
"or menu.\n\n"
@askdir-help
)
(default defguidepath)
)
)
(copyfiles
(source "SignArch.guide")
(dest guidepath)
(infos)
(prompt "Copying AmigaGuide documentation...")
(help
"The documentation needs to be copied to make sure that the "
"online help is available. It will be copied to '" guidepath
"'.\n\n"
@copyfiles-help
)
)
)
(set
guidepath
":::N/A:::"
)
)
; ****************** GET DIR FOR ACCESSORY PROGRAMS *********************
(if
(=
@user-level
2
)
(set
defpath
(askdir
(prompt
"Select a directory, preferably in your path, to install "
"needed accessory programs. Make sure that the name does "
"NOT contain spaces."
)
(help
"SignArch needs a few extra programs installed in the path "
"to function correctly. The 'c' directory on your boot "
"disk is usually a suitable place. Spaces must be avoided, "
"as the RX command doesn't understand them.\nIn addition, "
"a LhA replacement will be installed (named ShA).\n\n"
@askdir-help
)
(default "C:")
)
)
(set
defpath
"c:"
)
)
; ************** GUI PATH = DEFAULTPATH, COPY ACC. PRGS *****************
(set
@default-dest
defpath
)
(copyfiles
(source "ChkASCII")
(dest defpath)
(prompt "Copying accessory programs")
)
(copyfiles
(source "ChkDate")
(dest defpath)
(prompt "Copying accessory programs")
)
(copyfiles
(source "ShA")
(dest defpath)
(prompt "Copying LhA replacement")
)
; ************************** CREATE ENV-FILE ****************************
(set
@user-level
defuser
)
(if
(=
@user-level
2
)
(set
createenv
(askbool
(prompt "Do you wish that enviroment files shall be created?")
(help
"These files will tell the GUI where certain commands it "
"needs are located, namely PGP and RX. Two files will be "
"created, one in ENV: and one in ENVARC:."
)
(default 1)
(choices
"Yes"
"No"
)
)
)
)
(if
(=
createenv
1
)
(
(set
gchelp
(cat
"The programs need the location of the RX command, used for "
"starting REXX scripts. Please select it, so they are "
"aware of where it is.\n\n"
@askfile-help
)
)
(set
gcprompt
"Select RX command"
)
(set
gcdef
"Sys:Rexxc/RX"
)
(getcommand)
(set
rxcomm
gcretval
)
(set
gchelp
(cat
"The programs needs the location of the PGP program, used for "
"encryption, etc. Please select it, so they are aware of "
"where it is.\n\n"
@askfile-help
)
)
(set
gcprompt
"Select PGP command"
)
(set
gcdef
"Sys:c/PGP"
)
(getcommand)
(set
pgpcomm
gcretval
)
(set
gchelp
(cat
"The programs needs the location of the LhA program, used for "
"archiving. Please select it, so they are aware of "
"where it is.\n\n"
@askfile-help
)
)
(set
gcprompt
"Select LhA command"
)
(set
gcdef
"Sys:c/LhA"
)
(getcommand)
(set
lhacomm
gcretval
)
(set
gchelp
(cat
"The programs needs the location of the MD5Sum program, used for "
"creating message digests. Please select it, so they are aware of "
"where it is.\n\n"
@askfile-help
)
)
(set
gcprompt
"Select MD5Sum command"
)
(set
gcdef
"Sys:c/MD5Sum"
)
(getcommand)
(set
md5comm
gcretval
)
)
)
(set
@user-level
defuser
)
(if
(=
createenv
1
)
(
(if
(<>
":::N/A:::"
guidepath
)
(set
guidepath
(tackon
guidepath
"SignArch.guide"
)
)
)
(textfile
(prompt "Creating environment file for temporary use (ENV:)...")
(help
"This file helps the GUI find the commands it needs, that "
"is, PGP, RX and the REXX program."
)
(dest "ENV:SignArchGUIPaths")
(confirm)
(append
"PGP:"
pgpcomm
"\n"
"RXC:"
rxcomm
"\n"
"SCR:"
(tackon
rexxpath
"SignArch.rexx"
)
"\n"
"DOC:"
guidepath
"\n"
"LHA:"
lhacomm
"\n"
"MD5:"
md5comm
"\n"
"SMI:TRUE\n"
"ICN:TRUE\n"
)
)
(textfile
(prompt "Creating environment file for storage (ENVARC:)...")
(help
"This file helps the GUI find the commands it needs, "
"that is, PGP, RX and the REXX program."
)
(dest "ENVARC:SignArchGUIPaths")
(confirm)
(append
"PGP:"
pgpcomm
"\n"
"RXC:"
rxcomm
"\n"
"SCR:"
(tackon
rexxpath
"SignArch.rexx"
)
"\n"
"DOC:"
guidepath
"\n"
"LHA:"
lhacomm
"\n"
"MD5:"
md5comm
"\n"
"SMI:TRUE\n"
"ICN:TRUE\n"
)
)
)
)
(copyfiles
(source "Icons/sum_scr.info")
(dest "ENVARC:")
(prompt "Copying default icons to ENVARC:")
(help @copyfiles-help)
(infos)
)
(copyfiles
(source "Icons/sum_dta.info")
(dest "ENVARC:")
(prompt "Copying default icons to ENVARC:")
(help @copyfiles-help)
(infos)
)
(copyfiles
(source "Icons/sum_scr.info")
(dest "ENV:")
(prompt "Copying default icons to ENV:")
(help @copyfiles-help)
(infos)
)
(copyfiles
(source "Icons/sum_dta.info")
(dest "ENV:")
(prompt "Copying default icons to ENV:")
(help @copyfiles-help)
(infos)
)
; ************************* CREATE DUMMY FILE ***************************
(if
(=
@user-level
2
)
(set
dodummys
(askbool
(prompt
"Do you wish to install AmigaDOS dummy scripts (with "
"icons) in the selected path, which takes care of "
"invoking the REXX program?"
)
(help
"AmigaDOS won't find REXX programs automagically if they are "
"not in the current directory or REXX:\n"
"A workaround for this is to install a dummy AmigaDOS script "
"(which AmigaDOS DOES find) in your path, which you then can "
"access from everywhere.\n"
"PS! Even if you've installed the script in REXX:, such a "
"script may be useful if you're lazy - the name gets 5 chars "
"shorter, and icons will be copied, so you may start the "
"scripts from WB."
)
(choices
"Yes"
"No"
)
(default 1)
)
)
(set
dodummys
1
)
)
(set
@user-level
1
)
(if
(=
dodummys
1
)
(
(textfile
(dest
(tackon
guipath
"SignArch"
)
)
(append
(cat
".key FILELIST\n"
".bra {\n"
".ket }\n"
"; Dummy script for the SignArch REXX program\n\n"
"RX "
(tackon
rexxpath
"SignArch.rexx"
)
" {FILELIST}\n"
)
)
)
(textfile
(dest
(tackon
guipath
"AddSum"
)
)
(append
(cat
".key ARCHIVE,TMPDIR\n"
".bra {\n"
".ket }\n"
"; Dummy script for the AddSum REXX program\n\n"
"FailAt 10\n"
"If EQ \"\" \"{ARCHIVE}\"\n"
"\tSet ArcName `RequestFile PATTERN #?.(lha|lzh) TITLE \"Select archive to add sum to\"`\n"
"Else\n"
"\tSet ArcName \"{ARCHIVE}\"\n"
"EndIf\n"
"RX "
(tackon
rexxpath
"SignArch.rexx"
)
"\n"
"UnSet ArcName\n"
)
)
)
(copyfiles
(source "SignArch.info")
(dest guipath)
(prompt "Copying icon for dummy script")
)
(copyfiles
(source "AddSum.info")
(dest guipath)
(prompt "Copying icon for dummy script")
)
)
)
(set
@user-level
defuser
)
; ******************************* EXIT **********************************
(exit
(cat
"SignArch has now been installed. To run the program, type "
"'SignArch' in a Shell, or, easier, start SignArchGUI, found "
"within '"
guipath
"'.\n"
"For LhA entuiasts, the command is '"
(tackon
defpath
"ShA"
)
"' or '"
(tackon
defpath
"AddSum"
)
"'.\n\nHave fun."
)
)